From b48b91a0d8c6b4033d680df5e1067193ad52cb55 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 12 Dec 2022 19:43:45 +0200 Subject: [PATCH 1/5] Temporary disable the macOS-AMD64 packaging --- .github/workflows/release.yml | 41 +---------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2fab404a..3010725fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -254,40 +254,6 @@ jobs: name: Windows_amd64_checksum path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum retention-days: 2 - build-macos-amd64: - name: macOS AMD64 release asset - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Build project - id: make_dist - run: | - make dist-macos - cd dist - ARCHIVE=$(echo nimbus-eth2_macOS_amd64_*.tar.gz) - echo "::set-output name=archive::"${ARCHIVE} - echo "::set-output name=archive_dir::"${ARCHIVE%.tar.gz} - tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_beacon_node.sha512sum - tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_validator_client.sha512sum - - name: Upload archive artefact - uses: actions/upload-artifact@v2 - with: - name: macOS_amd64_archive - path: ./dist/${{ steps.make_dist.outputs.archive }} - retention-days: 2 - - name: Upload BN checksum artefact - uses: actions/upload-artifact@v2 - with: - name: macOS_amd64_checksum - path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum - retention-days: 2 - - name: Upload VC checksum artefact - uses: actions/upload-artifact@v2 - with: - name: macOS_amd64_checksum - path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum - retention-days: 2 build-macos-arm64: name: macOS ARM64 release asset runs-on: ubuntu-latest @@ -324,7 +290,7 @@ jobs: retention-days: 2 prepare-release: name: Prepare release draft - needs: [build-amd64, build-arm64, build-arm, build-win64, build-macos-amd64, build-macos-arm64] + needs: [build-amd64, build-arm64, build-arm, build-win64, build-macos-arm64] runs-on: ubuntu-latest steps: - name: Download artefacts @@ -354,8 +320,6 @@ jobs: cat Linux_arm_checksum/* >> release_notes.md echo '# Windows AMD64' >> release_notes.md cat Windows_amd64_checksum/* >> release_notes.md - echo '# macOS AMD64' >> release_notes.md - cat macOS_amd64_checksum/* >> release_notes.md echo '# macOS ARM64' >> release_notes.md cat macOS_arm64_checksum/* >> release_notes.md echo '```' >> release_notes.md @@ -376,7 +340,6 @@ jobs: Linux_arm_archive/* Linux_arm_packages/* Windows_amd64_archive/* - macOS_amd64_archive/* macOS_arm64_archive/* - name: Delete artefacts uses: geekyeggo/delete-artifact@v1 @@ -394,8 +357,6 @@ jobs: Linux_arm_packages Windows_amd64_archive Windows_amd64_checksum - macOS_amd64_archive - macOS_amd64_checksum macOS_arm64_archive macOS_arm64_checksum From 6057631741298165118e25b89ddb234a2f8bf5c9 Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 8 Dec 2022 21:57:47 +0000 Subject: [PATCH 2/5] fix bellatrix web3signer client-side beacon block signing requests (#4407) --- .../eth2_apis/eth2_rest_serialization.nim | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index e884abcc6..5f100d35d 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -1100,7 +1100,31 @@ proc readValue*[BlockType: Web3SignerForkedBeaconBlock]( capellaData: res.get()) proc writeValue*[ - BlockType: Web3SignerForkedBeaconBlock|ForkedBeaconBlock|ForkedBlindedBeaconBlock]( + BlockType: Web3SignerForkedBeaconBlock]( + writer: var JsonWriter[RestJson], + value: BlockType) {.raises: [IOError, Defect].} = + template forkIdentifier(id: string): auto = (static toUpperAscii id) + + # https://consensys.github.io/web3signer/web3signer-eth2.html#tag/Signing/operation/ETH2_SIGN + # https://github.com/ConsenSys/web3signer/blob/d51337e96ba5ce410222943556bed7c4856b8e57/core/src/main/java/tech/pegasys/web3signer/core/service/http/handlers/signing/eth2/json/BlockRequestDeserializer.java#L42-L58 + writer.beginRecord() + case value.kind + of BeaconBlockFork.Phase0: + writer.writeField("version", forkIdentifier "phase0") + writer.writeField("block", value.phase0Data) + of BeaconBlockFork.Altair: + writer.writeField("version", forkIdentifier "altair") + writer.writeField("block", value.altairData) + of BeaconBlockFork.Bellatrix: + writer.writeField("version", forkIdentifier "bellatrix") + writer.writeField("block_header", value.bellatrixData) + of BeaconBlockFork.Capella: + writer.writeField("version", forkIdentifier "capella") + writer.writeField("block_header", value.capellaData) + writer.endRecord() + +proc writeValue*[ + BlockType: ForkedBeaconBlock|ForkedBlindedBeaconBlock]( writer: var JsonWriter[RestJson], value: BlockType) {.raises: [IOError, Defect].} = @@ -1702,9 +1726,9 @@ proc writeValue*(writer: var JsonWriter[RestJson], if isSome(value.signingRoot): writer.writeField("signingRoot", value.signingRoot) - # https://github.com/ConsenSys/web3signer/blob/41834a927088f1bde7a097e17d19e954d0058e54/core/src/main/resources/openapi-specs/eth2/signing/schemas.yaml#L421-L425 (branch v22.7.0) - # It's the "beacon_block" field even when it's not a block, but a header + # https://github.com/ConsenSys/web3signer/blob/41c0cbfabcb1fca9587b59e058b7eb29f152c60c/core/src/main/resources/openapi-specs/eth2/signing/schemas.yaml#L418-L497 writer.writeField("beacon_block", value.beaconBlock) + of Web3SignerRequestKind.Deposit: writer.writeField("type", "DEPOSIT") if isSome(value.signingRoot): From 6a80b56d82dec42df4c402c1125c2aa297d242ab Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 12 Dec 2022 13:02:06 +0000 Subject: [PATCH 3/5] use VC-provided graffiti for blinded block proposals (#4417) --- beacon_chain/validators/validator_duties.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/beacon_chain/validators/validator_duties.nim b/beacon_chain/validators/validator_duties.nim index 67afce87d..74d9b4816 100644 --- a/beacon_chain/validators/validator_duties.nim +++ b/beacon_chain/validators/validator_duties.nim @@ -657,7 +657,8 @@ proc getBlindedBeaconBlock[T]( proc getBlindedBlockParts( node: BeaconNode, head: BlockRef, pubkey: ValidatorPubKey, - slot: Slot, randao: ValidatorSig, validator_index: ValidatorIndex): + slot: Slot, randao: ValidatorSig, validator_index: ValidatorIndex, + graffiti: GraffitiBytes): Future[Result[(bellatrix.ExecutionPayloadHeader, ForkedBeaconBlock), string]] {.async.} = let @@ -696,7 +697,7 @@ proc getBlindedBlockParts( getFieldNames(bellatrix.ExecutionPayloadHeader)) let newBlock = await makeBeaconBlockForHeadAndSlot( - node, randao, validator_index, node.graffitiBytes, head, slot, + node, randao, validator_index, graffiti, head, slot, execution_payload = Opt.some shimExecutionPayload, transactions_root = Opt.some executionPayloadHeader.get.transactions_root, execution_payload_root = @@ -715,7 +716,8 @@ proc proposeBlockMEV( randao: ValidatorSig, validator_index: ValidatorIndex): Future[Opt[BlockRef]] {.async.} = let blindedBlockParts = await getBlindedBlockParts( - node, head, validator.pubkey, slot, randao, validator_index) + node, head, validator.pubkey, slot, randao, validator_index, + node.graffitiBytes) if blindedBlockParts.isErr: # Not signed yet, fine to try to fall back on EL beacon_block_builder_missed_with_fallback.inc() @@ -787,7 +789,7 @@ proc makeBlindedBeaconBlockForHeadAndSlot*( forkyState.data.validators.item(validator_index).pubkey blindedBlockParts = await getBlindedBlockParts( - node, head, pubkey, slot, randao_reveal, validator_index) + node, head, pubkey, slot, randao_reveal, validator_index, graffiti) if blindedBlockParts.isErr: # Don't try EL fallback -- VC specifically requested a blinded block return err("Unable to create blinded block") From e4b1933773917f4db6db4613d1d962e84070bda6 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 12 Dec 2022 20:18:57 +0200 Subject: [PATCH 4/5] Version 22.11.1 --- CHANGELOG.md | 18 ++++++++++++++++++ beacon_chain/version.nim | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd771859..39fe7829d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +2022-12-12 v22.11.1 +=================== + +Nimbus `v22.11.1` is a `high-urgency` hotfix for users that use remote +keystores with a web3signer. It addresses a compatibility problem +that may result in missed block proposals. If you are not using a +remote signer, you can safely skip this release. + +### Fixes + +* Incompatible encoding used in the web3signer block signing requests + after the merge: + https://github.com/status-im/nimbus-eth2/pull/4407 + +* Ignored `graffiti` option of the validator client: + https://github.com/status-im/nimbus-eth2/pull/4417 + + 2022-11-30 v22.11.0 =================== diff --git a/beacon_chain/version.nim b/beacon_chain/version.nim index 54038c08b..271eeb474 100644 --- a/beacon_chain/version.nim +++ b/beacon_chain/version.nim @@ -21,7 +21,7 @@ when not defined(nimscript): const versionMajor* = 22 versionMinor* = 11 - versionBuild* = 0 + versionBuild* = 1 versionBlob* = "stateofus" # Single word - ends up in the default graffiti From 23c471a8f6cf267ee49cd4c7df919155892bc039 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Mon, 12 Dec 2022 20:19:30 +0200 Subject: [PATCH 5/5] Re-enable the macOS-AMD64 packaging --- .github/workflows/release.yml | 41 ++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3010725fd..e2fab404a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -254,6 +254,40 @@ jobs: name: Windows_amd64_checksum path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum retention-days: 2 + build-macos-amd64: + name: macOS AMD64 release asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build project + id: make_dist + run: | + make dist-macos + cd dist + ARCHIVE=$(echo nimbus-eth2_macOS_amd64_*.tar.gz) + echo "::set-output name=archive::"${ARCHIVE} + echo "::set-output name=archive_dir::"${ARCHIVE%.tar.gz} + tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_beacon_node.sha512sum + tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_validator_client.sha512sum + - name: Upload archive artefact + uses: actions/upload-artifact@v2 + with: + name: macOS_amd64_archive + path: ./dist/${{ steps.make_dist.outputs.archive }} + retention-days: 2 + - name: Upload BN checksum artefact + uses: actions/upload-artifact@v2 + with: + name: macOS_amd64_checksum + path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_beacon_node.sha512sum + retention-days: 2 + - name: Upload VC checksum artefact + uses: actions/upload-artifact@v2 + with: + name: macOS_amd64_checksum + path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_validator_client.sha512sum + retention-days: 2 build-macos-arm64: name: macOS ARM64 release asset runs-on: ubuntu-latest @@ -290,7 +324,7 @@ jobs: retention-days: 2 prepare-release: name: Prepare release draft - needs: [build-amd64, build-arm64, build-arm, build-win64, build-macos-arm64] + needs: [build-amd64, build-arm64, build-arm, build-win64, build-macos-amd64, build-macos-arm64] runs-on: ubuntu-latest steps: - name: Download artefacts @@ -320,6 +354,8 @@ jobs: cat Linux_arm_checksum/* >> release_notes.md echo '# Windows AMD64' >> release_notes.md cat Windows_amd64_checksum/* >> release_notes.md + echo '# macOS AMD64' >> release_notes.md + cat macOS_amd64_checksum/* >> release_notes.md echo '# macOS ARM64' >> release_notes.md cat macOS_arm64_checksum/* >> release_notes.md echo '```' >> release_notes.md @@ -340,6 +376,7 @@ jobs: Linux_arm_archive/* Linux_arm_packages/* Windows_amd64_archive/* + macOS_amd64_archive/* macOS_arm64_archive/* - name: Delete artefacts uses: geekyeggo/delete-artifact@v1 @@ -357,6 +394,8 @@ jobs: Linux_arm_packages Windows_amd64_archive Windows_amd64_checksum + macOS_amd64_archive + macOS_amd64_checksum macOS_arm64_archive macOS_arm64_checksum