From 5ef5b65ffe2be087ba0478c1d0d1b36279cd0e58 Mon Sep 17 00:00:00 2001 From: Potuz Date: Mon, 4 Nov 2024 10:59:41 -0300 Subject: [PATCH] Blocks after capella are execution (#14614) * Blocks after capella are execution * fix test --- CHANGELOG.md | 5 +++-- beacon-chain/core/blocks/payload.go | 3 +++ beacon-chain/core/blocks/payload_test.go | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 810e86d5d109..cf7e02dcec7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,8 +40,9 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve - Simplified `EjectedValidatorIndices`. - `engine_newPayloadV4`,`engine_getPayloadV4` are changes due to new execution request serialization decisions, [PR](https://github.com/prysmaticlabs/prysm/pull/14580) - Use ROBlock earlier in block syncing pipeline. -- Changed the signature of `ProcessPayload` -- Only Build the Protobuf state once during serialization +- Changed the signature of `ProcessPayload`. +- Only Build the Protobuf state once during serialization. +- Capella blocks are execution. ### Deprecated diff --git a/beacon-chain/core/blocks/payload.go b/beacon-chain/core/blocks/payload.go index e697fad104b1..6d52931b1418 100644 --- a/beacon-chain/core/blocks/payload.go +++ b/beacon-chain/core/blocks/payload.go @@ -61,6 +61,9 @@ func IsExecutionBlock(body interfaces.ReadOnlyBeaconBlockBody) (bool, error) { if body == nil { return false, errors.New("nil block body") } + if body.Version() >= version.Capella { + return true, nil + } payload, err := body.Execution() switch { case errors.Is(err, consensus_types.ErrUnsupportedField): diff --git a/beacon-chain/core/blocks/payload_test.go b/beacon-chain/core/blocks/payload_test.go index c56d725a95b2..38ce31eaa2d1 100644 --- a/beacon-chain/core/blocks/payload_test.go +++ b/beacon-chain/core/blocks/payload_test.go @@ -253,7 +253,8 @@ func Test_IsExecutionBlockCapella(t *testing.T) { require.NoError(t, err) got, err := blocks.IsExecutionBlock(wrappedBlock.Body()) require.NoError(t, err) - require.Equal(t, false, got) + // #14614 + require.Equal(t, true, got) } func Test_IsExecutionEnabled(t *testing.T) {