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..85841d3743c6 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,33 +1,33 @@ -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: dsaltares/fetch-gh-release-asset@aa2ab1243d6e0d5b405b973c89fa4d06a2d0fff7 # 1.1.2 + with: + repo: OffchainLabs/unclog + file: "unclog" + + - 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/WORKSPACE b/WORKSPACE index 7fa14f69c204..9fa4a648bc31 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -227,7 +227,7 @@ filegroup( url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz", ) -consensus_spec_version = "v1.5.0-beta.0" +consensus_spec_version = "v1.5.0-alpha.10" bls_test_version = "v0.1.1" @@ -243,7 +243,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-HdMlTN3wv+hUMCkIRPk+EHcLixY1cSZlvkx3obEp4AM=", + integrity = "sha256-NtWIhbO/mVMb1edq5jqABL0o8R1tNFiuG8PCMAsUHcs=", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/general.tar.gz" % consensus_spec_version, ) @@ -259,7 +259,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-eX/ihmHQ+OvfoGJxSMgy22yAU3SZ3xjsX0FU0EaZrSs=", + integrity = "sha256-DFlFlnzls1bBrDm+/xD8NK2ivvkhxR+rSNVLLqScVKc=", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/minimal.tar.gz" % consensus_spec_version, ) @@ -275,7 +275,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-k3Onf42vOzIqyddecR6G82sDy3mmDA+R8RN66QjB0GI=", + integrity = "sha256-G9ENPF8udZL/BqRHbi60GhFPnZDPZAH6UjcjRiOlvbk=", url = "https://github.com/ethereum/consensus-spec-tests/releases/download/%s/mainnet.tar.gz" % consensus_spec_version, ) @@ -290,7 +290,7 @@ filegroup( visibility = ["//visibility:public"], ) """, - integrity = "sha256-N/d4AwdOSlb70Dr+2l20dfXxNSzJDj/qKA9Rkn8Gb5w=", + integrity = "sha256-ClOLKkmAcEi8/uKi6LDeqthask5+E3sgxVoA0bqmQ0c=", strip_prefix = "consensus-specs-" + consensus_spec_version[1:], url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version, ) 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/beacon-chain/p2p/discovery_test.go b/beacon-chain/p2p/discovery_test.go index ae970b034c96..f81254950e73 100644 --- a/beacon-chain/p2p/discovery_test.go +++ b/beacon-chain/p2p/discovery_test.go @@ -370,10 +370,10 @@ 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" - exampleIP := "93.184.215.14" + // 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{ cfg: &Config{ diff --git a/beacon-chain/sync/rate_limiter_test.go b/beacon-chain/sync/rate_limiter_test.go index b1c22a4c45ff..1514b6459b39 100644 --- a/beacon-chain/sync/rate_limiter_test.go +++ b/beacon-chain/sync/rate_limiter_test.go @@ -18,7 +18,7 @@ import ( func TestNewRateLimiter(t *testing.T) { rlimiter := newRateLimiter(mockp2p.NewTestP2P(t)) - assert.Equal(t, 17, len(rlimiter.limiterMap), "correct number of topics not registered") + assert.Equal(t, 15, len(rlimiter.limiterMap), "correct number of topics not registered") } func TestNewRateLimiter_FreeCorrectly(t *testing.T) { 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) 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. 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/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) 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 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 diff --git a/config/params/loader_test.go b/config/params/loader_test.go index 3a692414041c..0fb84dde8364 100644 --- a/config/params/loader_test.go +++ b/config/params/loader_test.go @@ -38,7 +38,6 @@ var placeholderFields = []string{ "MAX_BLOB_COMMITMENTS_PER_BLOCK", // Compile time constant on BeaconBlockBodyDeneb.blob_kzg_commitments. "MAX_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm. "MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. - "MAX_PAYLOAD_SIZE", "MAX_REQUEST_BLOB_SIDECARS_FULU", "MAX_REQUEST_PAYLOADS", // Compile time constant on BeaconBlockBody.ExecutionRequests "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions. diff --git a/config/params/mainnet_config.go b/config/params/mainnet_config.go index 5befe7368e70..e9026c69e9e0 100644 --- a/config/params/mainnet_config.go +++ b/config/params/mainnet_config.go @@ -369,5 +369,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{