From 8d672290dc857b259850fe48ef0a951848a73f65 Mon Sep 17 00:00:00 2001 From: Agnish Ghosh Date: Thu, 9 Jan 2025 15:02:28 +0530 Subject: [PATCH 1/4] add engine_getBlobsV1 --- web3/engine_api.nim | 8 ++++++++ web3/engine_api_types.nim | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/web3/engine_api.nim b/web3/engine_api.nim index 5404db5..02acc1b 100644 --- a/web3/engine_api.nim +++ b/web3/engine_api.nim @@ -38,6 +38,7 @@ createRpcSigsFromNim(RpcClient): proc engine_getPayloadV4(payloadId: Bytes8): GetPayloadV4Response proc engine_getPayloadBodiesByHashV1(hashes: seq[Hash32]): seq[Opt[ExecutionPayloadBodyV1]] proc engine_getPayloadBodiesByRangeV1(start: Quantity, count: Quantity): seq[Opt[ExecutionPayloadBodyV1]] + proc engine_getBlobsV1(blob_versioned_hashes: Bytes32): GetBlobsV1Response # https://github.com/ethereum/execution-apis/blob/9301c0697e4c7566f0929147112f6d91f65180f6/src/engine/common.md proc engine_exchangeCapabilities(methods: seq[string]): seq[string] @@ -107,6 +108,13 @@ template getPayload*( payloadId: Bytes8): Future[GetPayloadV4Response] = engine_getPayloadV4(rpcClient, payloadId) +template getBlobs*( + rpcClient: RpcClient, + T: type GetBlobsV1Response, + blob_versioned_hashes: Bytes32): + Future[GetBlobsV1Response] = + engine_getBlobsV1(rpcClient, blob_versioned_hashes) + template newPayload*( rpcClient: RpcClient, payload: ExecutionPayloadV1): Future[PayloadStatusV1] = diff --git a/web3/engine_api_types.nim b/web3/engine_api_types.nim index bb08d3e..1e86646 100644 --- a/web3/engine_api_types.nim +++ b/web3/engine_api_types.nim @@ -127,6 +127,10 @@ type proofs*: seq[KzgProof] blobs*: seq[Blob] + BlobAndProofV1* = object + blob*: Blob + proof*: KzgProof + # https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/shanghai.md#executionpayloadbodyv1 # For optional withdrawals field, see: # https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/shanghai.md#engine_getpayloadbodiesbyhashv1 @@ -223,6 +227,9 @@ type shouldOverrideBuilder*: bool executionRequests*: seq[seq[byte]] + GetBlobsV1Response* = object + blobAndProof*: BlobAndProofV1 + SomeGetPayloadResponse* = ExecutionPayloadV1 | GetPayloadV2Response | From e35b4ef9dd986b3741b62bc7ad431b03a808ab6b Mon Sep 17 00:00:00 2001 From: tersec Date: Sat, 11 Jan 2025 03:21:01 +0000 Subject: [PATCH 2/4] only test in devel --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24b1269..9ab87eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: cpu: arm64 - os: windows cpu: amd64 - branch: [version-2-0, version-2-2, devel] + branch: [devel] include: - target: os: linux From 547b6bc442601efb5a872bd15038a90d98d5e472 Mon Sep 17 00:00:00 2001 From: tersec Date: Sat, 11 Jan 2025 03:35:39 +0000 Subject: [PATCH 3/4] no windows, no i386 --- .github/workflows/ci.yml | 72 ---------------------------------------- 1 file changed, 72 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ab87eb..1d10d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,10 @@ jobs: cpu: amd64 - os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04 cpu: amd64 - - os: linux - cpu: i386 - os: macos cpu: amd64 - os: macos cpu: arm64 - - os: windows - cpu: amd64 branch: [devel] include: - target: @@ -45,10 +41,6 @@ jobs: cpu: arm64 builder: macos-latest shell: bash - - target: - os: windows - builder: windows-latest - shell: msys2 {0} defaults: run: @@ -62,70 +54,6 @@ jobs: with: submodules: true - - name: Install build dependencies (Linux i386) - if: runner.os == 'Linux' && matrix.target.cpu == 'i386' - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ - --no-install-recommends -yq gcc-multilib g++-multilib \ - libssl-dev:i386 - mkdir -p external/bin - cat << EOF > external/bin/gcc - #!/bin/bash - exec $(which gcc) -m32 "\$@" - EOF - cat << EOF > external/bin/g++ - #!/bin/bash - exec $(which g++) -m32 "\$@" - EOF - chmod 755 external/bin/gcc external/bin/g++ - echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH - - - name: MSYS2 (Windows i386) - if: runner.os == 'Windows' && matrix.target.cpu == 'i386' - uses: msys2/setup-msys2@v2 - with: - path-type: inherit - msystem: MINGW32 - install: >- - base-devel - git - mingw-w64-i686-toolchain - - - name: MSYS2 (Windows amd64) - if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' - uses: msys2/setup-msys2@v2 - with: - path-type: inherit - install: >- - base-devel - git - mingw-w64-x86_64-toolchain - - - name: Restore Nim DLLs dependencies (Windows) from cache - if: runner.os == 'Windows' - id: windows-dlls-cache - uses: actions/cache@v4 - with: - path: external/dlls - key: 'dlls' - - - name: Install DLL dependencies (Windows) - if: > - steps.windows-dlls-cache.outputs.cache-hit != 'true' && - runner.os == 'Windows' - run: | - mkdir external - curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip - 7z x external/windeps.zip -oexternal/dlls - - - name: Path to cached dependencies (Windows) - if: > - runner.os == 'Windows' - run: | - echo '${{ github.workspace }}'"/external/dlls" >> $GITHUB_PATH - - name: Derive environment variables run: | if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then From fb4798cff3f47e2618bffc92a7c9bbf046589ba5 Mon Sep 17 00:00:00 2001 From: tersec Date: Sat, 11 Jan 2025 04:07:25 +0000 Subject: [PATCH 4/4] revert??? --- .github/workflows/ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d10d3b..9ab87eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,14 @@ jobs: cpu: amd64 - os: linux-gcc-14 # This is to use ubuntu 24 and install gcc 14. Should be removed when ubuntu-latest is 26.04 cpu: amd64 + - os: linux + cpu: i386 - os: macos cpu: amd64 - os: macos cpu: arm64 + - os: windows + cpu: amd64 branch: [devel] include: - target: @@ -41,6 +45,10 @@ jobs: cpu: arm64 builder: macos-latest shell: bash + - target: + os: windows + builder: windows-latest + shell: msys2 {0} defaults: run: @@ -54,6 +62,70 @@ jobs: with: submodules: true + - name: Install build dependencies (Linux i386) + if: runner.os == 'Linux' && matrix.target.cpu == 'i386' + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update -qq + sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ + --no-install-recommends -yq gcc-multilib g++-multilib \ + libssl-dev:i386 + mkdir -p external/bin + cat << EOF > external/bin/gcc + #!/bin/bash + exec $(which gcc) -m32 "\$@" + EOF + cat << EOF > external/bin/g++ + #!/bin/bash + exec $(which g++) -m32 "\$@" + EOF + chmod 755 external/bin/gcc external/bin/g++ + echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH + + - name: MSYS2 (Windows i386) + if: runner.os == 'Windows' && matrix.target.cpu == 'i386' + uses: msys2/setup-msys2@v2 + with: + path-type: inherit + msystem: MINGW32 + install: >- + base-devel + git + mingw-w64-i686-toolchain + + - name: MSYS2 (Windows amd64) + if: runner.os == 'Windows' && matrix.target.cpu == 'amd64' + uses: msys2/setup-msys2@v2 + with: + path-type: inherit + install: >- + base-devel + git + mingw-w64-x86_64-toolchain + + - name: Restore Nim DLLs dependencies (Windows) from cache + if: runner.os == 'Windows' + id: windows-dlls-cache + uses: actions/cache@v4 + with: + path: external/dlls + key: 'dlls' + + - name: Install DLL dependencies (Windows) + if: > + steps.windows-dlls-cache.outputs.cache-hit != 'true' && + runner.os == 'Windows' + run: | + mkdir external + curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip + 7z x external/windeps.zip -oexternal/dlls + + - name: Path to cached dependencies (Windows) + if: > + runner.os == 'Windows' + run: | + echo '${{ github.workspace }}'"/external/dlls" >> $GITHUB_PATH + - name: Derive environment variables run: | if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then