gloas: add builders registry and update state fields (#16164)

This pr implements the Gloas builder registry and related beacon state
fields per the spec, including proto/SSZ updates and state-native wiring
for builders, payload availability, pending payments/withdrawals, and
expected withdrawals. This aligns BeaconState with the Gloas container
changes and adds supporting hashing/copy helpers.

Spec ref:
https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/beacon-chain.md
This commit is contained in:
terence
2026-01-07 16:51:56 -05:00
committed by GitHub
parent 0fcb922702
commit c96d188468
28 changed files with 1453 additions and 791 deletions

View File

@@ -278,6 +278,7 @@ go_test(
"//testing/spectest/shared/fulu/rewards:go_default_library",
"//testing/spectest/shared/fulu/sanity:go_default_library",
"//testing/spectest/shared/fulu/ssz_static:go_default_library",
"//testing/spectest/shared/gloas/ssz_static:go_default_library",
"//testing/spectest/shared/phase0/epoch_processing:go_default_library",
"//testing/spectest/shared/phase0/finality:go_default_library",
"//testing/spectest/shared/phase0/operations:go_default_library",

View File

@@ -2,9 +2,10 @@ package mainnet
import (
"testing"
"github.com/OffchainLabs/prysm/v7/testing/spectest/shared/gloas/ssz_static"
)
func TestMainnet_Gloas_SSZStatic(t *testing.T) {
t.Skip("Gloas is not implemented")
// ssz_static.RunSSZStaticTests(t, "mainnet")
ssz_static.RunSSZStaticTests(t, "mainnet")
}

View File

@@ -288,6 +288,7 @@ go_test(
"//testing/spectest/shared/fulu/rewards:go_default_library",
"//testing/spectest/shared/fulu/sanity:go_default_library",
"//testing/spectest/shared/fulu/ssz_static:go_default_library",
"//testing/spectest/shared/gloas/ssz_static:go_default_library",
"//testing/spectest/shared/phase0/epoch_processing:go_default_library",
"//testing/spectest/shared/phase0/finality:go_default_library",
"//testing/spectest/shared/phase0/operations:go_default_library",

View File

@@ -2,9 +2,10 @@ package minimal
import (
"testing"
"github.com/OffchainLabs/prysm/v7/testing/spectest/shared/gloas/ssz_static"
)
func TestMinimal_Gloas_SSZStatic(t *testing.T) {
t.Skip("Gloas is not implemented")
// ssz_static.RunSSZStaticTests(t, "minimal")
ssz_static.RunSSZStaticTests(t, "minimal")
}

View File

@@ -6,6 +6,7 @@ import (
"testing"
state_native "github.com/OffchainLabs/prysm/v7/beacon-chain/state/state-native"
// enginev1 "github.com/OffchainLabs/prysm/v7/proto/engine/v1"
enginev1 "github.com/OffchainLabs/prysm/v7/proto/engine/v1"
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
"github.com/OffchainLabs/prysm/v7/testing/require"
@@ -56,6 +57,8 @@ func unmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (a
obj = &ethpb.BeaconBlockBodyGloas{}
case "BeaconState":
obj = &ethpb.BeaconStateGloas{}
case "Builder":
obj = &ethpb.Builder{}
case "BuilderPendingPayment":
obj = &ethpb.BuilderPendingPayment{}
case "BuilderPendingWithdrawal":
@@ -70,6 +73,8 @@ func unmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (a
t.Skip("Not a consensus type")
case "DataColumnSidecar":
obj = &ethpb.DataColumnSidecarGloas{}
case "SignedProposerPreferences", "ProposerPreferences":
t.Skip("p2p-only type; not part of the consensus state transition")
// Standard types that also exist in gloas
case "ExecutionPayload":