From 2000ef457b351cf7defd632bb590d1aa619a55d0 Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:22:38 -0600 Subject: [PATCH 1/6] Move prysm to unclog for changelog management (#14782) Co-authored-by: Kasey Kirkham --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/changelog.yml | 48 ++++++++++++----------- CHANGELOG.md | 64 ------------------------------- CONTRIBUTING.md | 16 +++----- changelog/kasey_changelog-tool.md | 55 ++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 99 deletions(-) create mode 100644 changelog/kasey_changelog-tool.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4298e714f1f9..85fca8ff990f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -33,5 +33,5 @@ Fixes # **Acknowledgements** - [ ] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md). -- [ ] I have made an appropriate entry to [CHANGELOG.md](https://github.com/prysmaticlabs/prysm/blob/develop/CHANGELOG.md). +- [ ] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd). - [ ] I have added a description to this PR with sufficient context for reviewers to understand this PR. diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index d44281e341db..62053ee73768 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,33 +1,35 @@ -name: CI +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: changelog on: pull_request: - branches: - - develop + branches: [ "develop" ] jobs: - changed_files: - runs-on: ubuntu-latest - name: Check CHANGELOG.md + run-changelog-check: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: changelog modified - id: changelog-modified + - name: Checkout source code + uses: actions/checkout@v3 + + - name: Download unclog binary + uses: actions/download-artifact@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: OffchainLabs/unclog + name: unclog + run-id: 12679708867 + + - name: Get new changelog files + id: new-changelog-files uses: tj-actions/changed-files@v45 with: - files: CHANGELOG.md + files: | + changelog/**.md - - name: List all changed files + - name: Run lint command env: - ALL_CHANGED_FILES: ${{ steps.changelog-modified.outputs.all_changed_files }} - run: | - if [[ ${ALL_CHANGED_FILES[*]} =~ (^|[[:space:]])"CHANGELOG.md"($|[[:space:]]) ]]; - then - echo "CHANGELOG.md was modified."; - exit 0; - else - echo "CHANGELOG.md was not modified."; - echo "Please see CHANGELOG.md and follow the instructions to add your changes to that file." - echo "In some rare scenarios, a changelog entry is not required and this CI check can be ignored." - exit 1; - fi + ALL_ADDED_MARKDOWN: ${{ steps.new-changelog-files.outputs.added_files }} + run: chmod +x unclog && ./unclog check -fragment-env=ALL_ADDED_MARKDOWN diff --git a/CHANGELOG.md b/CHANGELOG.md index cba8fb64f8ec..18d61c61fd47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,70 +4,6 @@ All notable changes to this project will be documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning. -## [Unreleased](https://github.com/prysmaticlabs/prysm/compare/v5.2.0...HEAD) - -### Added - -- Added proper gas limit check for header from the builder. -- Added an error field to log `Finished building block`. -- Implemented a new `EmptyExecutionPayloadHeader` function. -- `Finished building block`: Display error only if not nil. -- Added support to update target and max blob count to different values per hard fork config. -- Log before blob filesystem cache warm-up. -- New design for the attestation pool. [PR](https://github.com/prysmaticlabs/prysm/pull/14324) -- Add field param placeholder for Electra blob target and max to pass spec tests. -- Add EIP-7691: Blob throughput increase. -- SSZ files generation: Remove the `// Hash: ...` header. -- DB optimization for saving light client bootstraps (save unique sync committees only). -- Trace IDONTWANT Messages in Pubsub. -- Add Fulu fork boilerplate. -- Separate type for unaggregated network attestations. [PR](https://github.com/prysmaticlabs/prysm/pull/14659) -- Update spec tests to v1.5.0-beta.0. - -### Changed - -- Process light client finality updates only for new finalized epochs instead of doing it for every block. -- Refactor subnets subscriptions. -- Refactor RPC handlers subscriptions. -- Go deps upgrade, from `ioutil` to `io` -- Move successfully registered validator(s) on builder log to debug. -- Update some test files to use `crypto/rand` instead of `math/rand` -- Enforce Compound prefix (0x02) for target when processing pending consolidation request. -- Limit consolidating by validator's effective balance. -- Use 16-bit random value for proposer and sync committee selection filter. -- Re-organize the content of the `*.proto` files (No functional change). -- Updated spec definitions for `process_slashings` in godocs. Simplified `ProcessSlashings` API. -- Updated spec definition electra `process_registry_updates`. -- Updated Electra spec definition for `process_epoch`. -- Update our `go-libp2p-pubsub` dependency. -- Re-organize the content of files to ease the creation of a new fork boilerplate. -- Fixed Metadata errors for peers connected via QUIC. -- Process light client finality updates only for new finalized epochs instead of doing it for every block. -- Update blobs by rpc topics from V2 to V1. -- Updated geth to 1.14 ~ -- E2e tests start from bellatrix - -### Deprecated - - -### Removed - -- Cleanup ProcessSlashings method to remove unnecessary argument. -- Remove `/proto/eth/v2` directory. [PR](https://github.com/prysmaticlabs/prysm/pull/14765) -- Remove `/memsize/` pprof endpoint as it will no longer be supported in go 1.23, geth also removed in https://github.com/ethereum/go-ethereum/commit/e4675771eda550e7eeb63a8884816982c1980644 - -### Fixed - -- Added check to prevent nil pointer deference or out of bounds array access when validating the BLSToExecutionChange on an impossibly nil validator. -- EIP-7691: Ensure new blobs subnets are subscribed on epoch in advance. -- Fix kzg commitment inclusion proof depth minimal value. - -### Security - -- go version upgrade to 1.22.10 for CVE CVE-2024-34156 -- Update golang.org/x/crypto to v0.31.0 to address CVE-2024-45337 -- Update golang.org/x/net to v0.33.0 to address CVE-2024-45338 - ## [v5.2.0](https://github.com/prysmaticlabs/prysm/compare/v5.1.2...v5.2.0) Updating to this release is highly recommended, especially for users running v5.1.1 or v5.1.2. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2bf1d566e3c2..f8b85751f347 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,7 +125,7 @@ Navigate to your fork of the repo on GitHub. On the upper left where the current **16. Add an entry to CHANGELOG.md.** -If your change is user facing, you must include a CHANGELOG.md entry. See the [Maintaining CHANGELOG.md](#maintaining-changelogmd) section for more information. +All PRs must must include a changelog fragment file in the `changelog` directory. If your change is not user-facing or should not be mentioned in the changelog for some other reason, you may use the `Ignored` changelog section in your fragment's header to satisfy this requirement without altering the final release changelog. See the [Maintaining CHANGELOG.md](#maintaining-changelogmd) section for more information. **17. Create a pull request.** @@ -177,16 +177,10 @@ $ git push myrepo feature-in-progress-branch -f ## Maintaining CHANGELOG.md -This project follows the changelog guidelines from [keepachangelog.com](https://keepachangelog.com/en/1.1.0/). - -All PRs with user facing changes should have an entry in the CHANGELOG.md file and the change should be categorized in the appropriate category within the "Unreleased" section. The categories are: - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. Please see the [Security Policy](SECURITY.md) for responsible disclosure before adding a change with this category. +This project follows the changelog guidelines from [keepachangelog.com](https://keepachangelog.com/en/1.1.0/). In order to minimize conflicts and workflow headaches, we chose to implement a changelog management +strategy that uses changelog "fragment" files, managed by our changelog management tool called `unclog`. Each PR must include a new changelog fragment file in the `changelog` directory, as specified by unclog's +[README.md](https://github.com/OffchainLabs/unclog?tab=readme-ov-file#what-is-a-changelog-fragment). As the `unclog` README suggests in the [Best Practices](https://github.com/OffchainLabs/unclog?tab=readme-ov-file#best-practices) section, +the standard naming convention for your PR's fragment file, to avoid conflicting with another fragment file, is `changelog/_.md`. ### Releasing diff --git a/changelog/kasey_changelog-tool.md b/changelog/kasey_changelog-tool.md new file mode 100644 index 000000000000..cebbdd671cc9 --- /dev/null +++ b/changelog/kasey_changelog-tool.md @@ -0,0 +1,55 @@ +### Added + +- Added an error field to log `Finished building block`. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14696) +- Implemented a new `EmptyExecutionPayloadHeader` function. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14713) +- Added proper gas limit check for header from the builder. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14707) +- `Finished building block`: Display error only if not nil. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14722) +- Added light client feature flag check to RPC handlers. [PR](https://github.com/prysmaticlabs/prysm/pull/14736) +- Added support to update target and max blob count to different values per hard fork config. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14678) +- Log before blob filesystem cache warm-up. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14735) +- New design for the attestation pool. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14324) +- Add field param placeholder for Electra blob target and max to pass spec tests. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14733) +- Light client: Add better error handling. [PR](https://github.com/prysmaticlabs/prysm/pull/14749) +- Add EIP-7691: Blob throughput increase. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14750) +- Trace IDONTWANT Messages in Pubsub. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14778) +- Add Fulu fork boilerplate. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14771) +- DB optimization for saving light client bootstraps (save unique sync committees only) +- Separate type for unaggregated network attestations. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14659) + + +### Changed + +- Process light client finality updates only for new finalized epochs instead of doing it for every block. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14713) +- Refactor subnets subscriptions. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14711) +- Refactor RPC handlers subscriptions. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14732) +- Go deps upgrade, from `ioutil` to `io`. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14737) +- Move successfully registered validator(s) on builder log to debug. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14735) +- Update some test files to use `crypto/rand` instead of `math/rand`. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14747) +- Re-organize the content of the `*.proto` files (No functional change). [[PR]](https://github.com/prysmaticlabs/prysm/pull/14755) +- SSZ files generation: Remove the `// Hash: ...` header.[[PR]](https://github.com/prysmaticlabs/prysm/pull/14760) +- Updated Electra spec definition for `process_epoch`. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14768) +- Update our `go-libp2p-pubsub` dependency. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14770) +- Re-organize the content of files to ease the creation of a new fork boilerplate. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14761) +- Updated spec definition electra `process_registry_updates`. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14767) +- Fixed Metadata errors for peers connected via QUIC. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14776) +- Updated spec definitions for `process_slashings` in godocs. Simplified `ProcessSlashings` API. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14766) +- Update spec tests to v1.5.0-beta.0. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14788) +- Process light client finality updates only for new finalized epochs instead of doing it for every block. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14718) +- Update blobs by rpc topics from V2 to V1. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14785) + +### Fixed + +- Added check to prevent nil pointer deference or out of bounds array access when validating the BLSToExecutionChange on an impossibly nil validator. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14705) +- EIP-7691: Ensure new blobs subnets are subscribed on epoch in advance. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14759) +- Fix kzg commitment inclusion proof depth minimal value. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14787) + +### Removed + +- Cleanup ProcessSlashings method to remove unnecessary argument. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14762) +- Remove `/proto/eth/v2` directory. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14765) + +### Security + +- go version upgrade to 1.22.10 for CVE CVE-2024-34156. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14729) +- Update golang.org/x/crypto to v0.31.0 to address CVE-2024-45337. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14777) +- Update golang.org/x/net to v0.33.0 to address CVE-2024-45338. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14780) From e8c968326a6e7400fdc3fabcbf2c9fe03c47cc4c Mon Sep 17 00:00:00 2001 From: kasey <489222+kasey@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:47:20 -0600 Subject: [PATCH 2/6] switch to unclog latest release instead of run artifact (#14793) * use latest unclog release instead of run artifact * add missing changelog entries to pre-unclog starter pack --------- Co-authored-by: Kasey Kirkham --- .github/workflows/changelog.yml | 8 +++----- changelog/kasey_stabilize-unclog.md | 13 +++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 changelog/kasey_stabilize-unclog.md diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 62053ee73768..85841d3743c6 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,12 +15,10 @@ jobs: uses: actions/checkout@v3 - name: Download unclog binary - uses: actions/download-artifact@v4 + uses: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # 1.1.2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: OffchainLabs/unclog - name: unclog - run-id: 12679708867 + repo: OffchainLabs/unclog + file: "unclog" - name: Get new changelog files id: new-changelog-files diff --git a/changelog/kasey_stabilize-unclog.md b/changelog/kasey_stabilize-unclog.md new file mode 100644 index 000000000000..d559f4e19afd --- /dev/null +++ b/changelog/kasey_stabilize-unclog.md @@ -0,0 +1,13 @@ +### Changed + +- Updated geth to 1.14~. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14351) +- E2e tests start from bellatrix. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14351) + +### Removed + +- Remove `/memsize/` pprof endpoint as it will no longer be supported in go 1.23. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14351) + +### Ignored + +- switches unclog from using a flaky github artifact to using a stable release asset. +- Adds changelog entries that were missing from the branch switching prysm over to unclog. From 34ff4c3ea9e72610c043af8fffb287b7aba1c2c2 Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:14:25 +0900 Subject: [PATCH 3/6] Replace new `exampleIP` for `example.org` (#14795) * Replace new exampleIP for example.org * Add changelog --- beacon-chain/p2p/discovery_test.go | 2 +- changelog/syjn99_change-example-ip-address.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog/syjn99_change-example-ip-address.md diff --git a/beacon-chain/p2p/discovery_test.go b/beacon-chain/p2p/discovery_test.go index ed8391304ca5..6c371b7964f1 100644 --- a/beacon-chain/p2p/discovery_test.go +++ b/beacon-chain/p2p/discovery_test.go @@ -357,7 +357,7 @@ func TestHostIsResolved(t *testing.T) { // As defined in RFC 2606 , example.org is a // reserved example domain name. exampleHost := "example.org" - exampleIP := "93.184.215.14" + exampleIP := "96.7.129.13" s := &Service{ cfg: &Config{ diff --git a/changelog/syjn99_change-example-ip-address.md b/changelog/syjn99_change-example-ip-address.md new file mode 100644 index 000000000000..f9fdce99cecb --- /dev/null +++ b/changelog/syjn99_change-example-ip-address.md @@ -0,0 +1,3 @@ +### Fixed + +- Replace exampleIP to `96.7.129.13` \ No newline at end of file From 72cc63a6a39e3b486d5dd733f25a8487e0d3450b Mon Sep 17 00:00:00 2001 From: Jun Song <87601811+syjn99@users.noreply.github.com> Date: Thu, 16 Jan 2025 00:42:21 +0900 Subject: [PATCH 4/6] Clean `TestCanUpgrade*` tests (#14791) * Clean TestCanUpgrade* tests * Add new changelog file --- beacon-chain/core/time/slot_epoch_test.go | 80 +++-------------------- changelog/syjn99_clean-upgrade-tests.md | 3 + 2 files changed, 13 insertions(+), 70 deletions(-) create mode 100644 changelog/syjn99_clean-upgrade-tests.md diff --git a/beacon-chain/core/time/slot_epoch_test.go b/beacon-chain/core/time/slot_epoch_test.go index 0b151ea9e8d0..8456b3a1643e 100644 --- a/beacon-chain/core/time/slot_epoch_test.go +++ b/beacon-chain/core/time/slot_epoch_test.go @@ -84,76 +84,6 @@ func TestNextEpoch_OK(t *testing.T) { } } -func TestCanUpgradeToAltair(t *testing.T) { - params.SetupTestConfigCleanup(t) - bc := params.BeaconConfig() - bc.AltairForkEpoch = 5 - params.OverrideBeaconConfig(bc) - tests := []struct { - name string - slot primitives.Slot - want bool - }{ - { - name: "not epoch start", - slot: 1, - want: false, - }, - { - name: "not altair epoch", - slot: params.BeaconConfig().SlotsPerEpoch, - want: false, - }, - { - name: "altair epoch", - slot: primitives.Slot(params.BeaconConfig().AltairForkEpoch) * params.BeaconConfig().SlotsPerEpoch, - want: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := time.CanUpgradeToAltair(tt.slot); got != tt.want { - t.Errorf("canUpgradeToAltair() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestCanUpgradeBellatrix(t *testing.T) { - params.SetupTestConfigCleanup(t) - bc := params.BeaconConfig() - bc.BellatrixForkEpoch = 5 - params.OverrideBeaconConfig(bc) - tests := []struct { - name string - slot primitives.Slot - want bool - }{ - { - name: "not epoch start", - slot: 1, - want: false, - }, - { - name: "not bellatrix epoch", - slot: params.BeaconConfig().SlotsPerEpoch, - want: false, - }, - { - name: "bellatrix epoch", - slot: primitives.Slot(params.BeaconConfig().BellatrixForkEpoch) * params.BeaconConfig().SlotsPerEpoch, - want: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := time.CanUpgradeToBellatrix(tt.slot); got != tt.want { - t.Errorf("CanUpgradeToBellatrix() = %v, want %v", got, tt.want) - } - }) - } -} - func TestCanProcessEpoch_TrueOnEpochsLastSlot(t *testing.T) { tests := []struct { slot primitives.Slot @@ -273,6 +203,16 @@ func TestCanUpgradeTo(t *testing.T) { forkEpoch *primitives.Epoch upgradeFunc func(primitives.Slot) bool }{ + { + name: "Altair", + forkEpoch: &beaconConfig.AltairForkEpoch, + upgradeFunc: time.CanUpgradeToAltair, + }, + { + name: "Bellatrix", + forkEpoch: &beaconConfig.BellatrixForkEpoch, + upgradeFunc: time.CanUpgradeToBellatrix, + }, { name: "Capella", forkEpoch: &beaconConfig.CapellaForkEpoch, diff --git a/changelog/syjn99_clean-upgrade-tests.md b/changelog/syjn99_clean-upgrade-tests.md new file mode 100644 index 000000000000..09e05ddd0723 --- /dev/null +++ b/changelog/syjn99_clean-upgrade-tests.md @@ -0,0 +1,3 @@ +### Removed + +- Clean `TestCanUpgrade*` tests \ No newline at end of file From ef293e52f8d0e5948cca8c5e5523292af9c6f92e Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Wed, 15 Jan 2025 12:07:00 -0600 Subject: [PATCH 5/6] Use ip.addr.tools for DNS resolution test in p2p (#14800) * Use ip.addr.tools for DNS resolution test in p2p * Changelog fragment --- beacon-chain/p2p/discovery_test.go | 6 +++--- changelog/pvl_dns_test_fix.md | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 changelog/pvl_dns_test_fix.md diff --git a/beacon-chain/p2p/discovery_test.go b/beacon-chain/p2p/discovery_test.go index 6c371b7964f1..055638c4ba82 100644 --- a/beacon-chain/p2p/discovery_test.go +++ b/beacon-chain/p2p/discovery_test.go @@ -354,9 +354,9 @@ func TestStaticPeering_PeersAreAdded(t *testing.T) { } func TestHostIsResolved(t *testing.T) { - // As defined in RFC 2606 , example.org is a - // reserved example domain name. - exampleHost := "example.org" + // ip.addr.tools - construct domain names that resolve to any given IP address + // ex: 192-0-2-1.ip.addr.tools resolves to 192.0.2.1. + exampleHost := "96-7-129-13.ip.addr.tools" exampleIP := "96.7.129.13" s := &Service{ diff --git a/changelog/pvl_dns_test_fix.md b/changelog/pvl_dns_test_fix.md new file mode 100644 index 000000000000..09c626e7a736 --- /dev/null +++ b/changelog/pvl_dns_test_fix.md @@ -0,0 +1,3 @@ +### Fixed + +- Fixed a p2p test to reliably return a static IP through DNS resolution. [[PR]](https://github.com/prysmaticlabs/prysm/pull/14800) From e07341e1d584713a947f7c6bf64e63dbfde28b83 Mon Sep 17 00:00:00 2001 From: Manu NALEPA Date: Wed, 15 Jan 2025 20:50:48 +0100 Subject: [PATCH 6/6] `ToBlinded`: Use Fulu. (#14797) * `ToBlinded`: Use Fulu. * Fix Sammy's comment. * `unmarshalState`: Use `hasFuluKey`. --- beacon-chain/db/kv/state.go | 13 +++++++++ changelog/manu_fulu_to_blinded.md | 3 ++ config/params/mainnet_config.go | 2 +- consensus-types/blocks/execution.go | 5 +++- consensus-types/blocks/getters.go | 43 +++++++++++++++++++++++++++-- 5 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 changelog/manu_fulu_to_blinded.md diff --git a/beacon-chain/db/kv/state.go b/beacon-chain/db/kv/state.go index 18fd75e228de..d2e01025a826 100644 --- a/beacon-chain/db/kv/state.go +++ b/beacon-chain/db/kv/state.go @@ -517,6 +517,19 @@ func (s *Store) unmarshalState(_ context.Context, enc []byte, validatorEntries [ } switch { + case hasFuluKey(enc): + protoState := ðpb.BeaconStateFulu{} + if err := protoState.UnmarshalSSZ(enc[len(fuluKey):]); err != nil { + return nil, errors.Wrap(err, "failed to unmarshal encoding for Electra") + } + ok, err := s.isStateValidatorMigrationOver() + if err != nil { + return nil, err + } + if ok { + protoState.Validators = validatorEntries + } + return statenative.InitializeFromProtoUnsafeFulu(protoState) case hasElectraKey(enc): protoState := ðpb.BeaconStateElectra{} if err := protoState.UnmarshalSSZ(enc[len(electraKey):]); err != nil { diff --git a/changelog/manu_fulu_to_blinded.md b/changelog/manu_fulu_to_blinded.md new file mode 100644 index 000000000000..b2cc40bc46f4 --- /dev/null +++ b/changelog/manu_fulu_to_blinded.md @@ -0,0 +1,3 @@ +### Fixed + +- `ToBlinded`: Use Fulu struct for Fulu (instead of Electra) \ No newline at end of file diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 802ca47c6d66..c5072878a2b1 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -366,5 +366,5 @@ func FillTestVersions(c *BeaconChainConfig, b byte) { c.CapellaForkVersion[0] = 3 c.DenebForkVersion[0] = 4 c.ElectraForkVersion[0] = 5 - c.FuluForkVersion[0] = 5 + c.FuluForkVersion[0] = 6 } diff --git a/consensus-types/blocks/execution.go b/consensus-types/blocks/execution.go index 919deb0335d5..e01901a7d782 100644 --- a/consensus-types/blocks/execution.go +++ b/consensus-types/blocks/execution.go @@ -784,7 +784,10 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution }, nil } -var PayloadToHeaderElectra = PayloadToHeaderDeneb +var ( + PayloadToHeaderElectra = PayloadToHeaderDeneb + PayloadToHeaderFulu = PayloadToHeaderDeneb +) // IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has // a non-zero value, this function will return false. diff --git a/consensus-types/blocks/getters.go b/consensus-types/blocks/getters.go index 6d0911643852..99f9dbf5cd99 100644 --- a/consensus-types/blocks/getters.go +++ b/consensus-types/blocks/getters.go @@ -166,6 +166,43 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e return nil, err } + if b.version >= version.Fulu { + p, ok := payload.Proto().(*enginev1.ExecutionPayloadDeneb) + if !ok { + return nil, fmt.Errorf("%T is not an execution payload header of Deneb version", p) + } + header, err := PayloadToHeaderFulu(payload) + if err != nil { + return nil, errors.Wrap(err, "payload to header fulu") + } + + return initBlindedSignedBlockFromProtoFulu( + ð.SignedBlindedBeaconBlockFulu{ + Message: ð.BlindedBeaconBlockFulu{ + Slot: b.block.slot, + ProposerIndex: b.block.proposerIndex, + ParentRoot: b.block.parentRoot[:], + StateRoot: b.block.stateRoot[:], + Body: ð.BlindedBeaconBlockBodyFulu{ + RandaoReveal: b.block.body.randaoReveal[:], + Eth1Data: b.block.body.eth1Data, + Graffiti: b.block.body.graffiti[:], + ProposerSlashings: b.block.body.proposerSlashings, + AttesterSlashings: b.block.body.attesterSlashingsElectra, + Attestations: b.block.body.attestationsElectra, + Deposits: b.block.body.deposits, + VoluntaryExits: b.block.body.voluntaryExits, + SyncAggregate: b.block.body.syncAggregate, + ExecutionPayloadHeader: header, + BlsToExecutionChanges: b.block.body.blsToExecutionChanges, + BlobKzgCommitments: b.block.body.blobKzgCommitments, + ExecutionRequests: b.block.body.executionRequests, + }, + }, + Signature: b.signature[:], + }) + } + if b.version >= version.Electra { p, ok := payload.Proto().(*enginev1.ExecutionPayloadDeneb) if !ok { @@ -173,7 +210,7 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e } header, err := PayloadToHeaderElectra(payload) if err != nil { - return nil, err + return nil, errors.Wrap(err, "payload to header electra") } return initBlindedSignedBlockFromProtoElectra( ð.SignedBlindedBeaconBlockElectra{ @@ -206,7 +243,7 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e case *enginev1.ExecutionPayload: header, err := PayloadToHeader(payload) if err != nil { - return nil, err + return nil, errors.Wrap(err, "payload to header") } return initBlindedSignedBlockFromProtoBellatrix( ð.SignedBlindedBeaconBlockBellatrix{ @@ -261,7 +298,7 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e case *enginev1.ExecutionPayloadDeneb: header, err := PayloadToHeaderDeneb(payload) if err != nil { - return nil, err + return nil, errors.Wrap(err, "payload to header deneb") } return initBlindedSignedBlockFromProtoDeneb( ð.SignedBlindedBeaconBlockDeneb{